
{% block content %}
<head>
<script type="text/javascript" src="/my-media/js/jquery.js"></script>
<script type="text/javascript" src="/my-media/js/jquery.innerfade.js"></script>
<script type="text/javascript" src="/my-media/js/jquery.form.js"></script>
<script type="text/javascript">
$( document ).ready( function() {
	
$( '#commentSubmit' ).click( function() {
		alert('Your data has been saved.');
		
  });
 
}); 
</script>
</head>
<body>
<div>
{% if user.is_authenticated %}
 {{s.stock_name}}
           <table > 
  
       <tr><th>User</th><th>Recommendation</th><th>Text</th></tr> 
                                  
                                 {% for rec in rec %} 
                                  
                                 <tr> 
                                 <td>{{rec.user}}</td> 
                                 <td>{{rec.type}}</td> 
                                 <td>{{rec.text}}</td> 
                                  
                                  
                  {%ifnotequal has_rated.user rec.user%} 
                                 <td>    <a href="/personalstock/commentrating/{{ s.stock_name }}/{{rec.id}}">Rating</a></td> 
                  {%endifnotequal%} 
                                  
                                 </tr> 
                                 {% endfor %} 
                                 </table> 
                              {% if has_rated %} 
                                 already voted: User {{ has_rated.user }}, 
                                recommend to {{ has_rated.type }}, 
                                 {{ has_rated.text }} for  {{s.stock_name}} 
                                  

              {% else %} 
                <form action="" method="POST"> 
               {{ form.as_p }} 
                <input id="commentSubmit" type="submit" name="submit" value="Submit" /> 
                </form> 
              {% endif %}
              </div>
              </body>
             {%endif%}
               
{% endblock %}